package com.xsr.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import javax.xml.ws.RequestWrapper;
import java.io.IOException;
import java.util.Map;

/**
 * @author 邢式瑞
 * @version 1.0
 * @project springMvc02
 * @date 2022/9/8 10:19
 */
@Controller
public class Controller01 {
    @RequestMapping("/hello")
    public  void hello(HttpServletRequest request, HttpServletResponse response, HttpSession httpSession) throws ServletException, IOException {

        request.getRequestDispatcher("/index.jsp").forward(request,response);
    }

    @RequestMapping("/hello1")
    public  ModelAndView hello1(Integer id){
        ModelAndView modelAndView = new ModelAndView();
        modelAndView.addObject("name","就好");
         return modelAndView;

    }
    @RequestMapping("/h")
    public  String  h(Map map){
        map.put("name","剌妹");
        return "/index.jsp";
    }

}
